<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>剁手复制</title>
	<include file="Common/headerStyle" />
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
</head>
<body>

<div class="main-container">
	<div class="main-content">
		<div class="row">
			<div class="col-sm-10 col-sm-offset-1">
				<div class="login-container">
					<div class="center">
						<h4 class="blue">
							<img src="__PUBLIC__/images/app@2x.png" class="img-circle">		
						</h4>
					</div>

					<div class="space-6"></div>

					<div class="position-relative">
						<div id="login-box" class="login-box visible widget-box no-border">
							<div class="widget-body">
								<div class="widget-main">
									<h4 class="header blue lighter bigger" style="text-align:center;">
										<div id="kouling">
											<p><h1 id="kouling<{$Think.get.goodsid}>"><{$kl}></h1></p>
										</div>
									</h4>
								<div style="text-align:center;">
									<p><button class="btn" data-clipboard-action="copy" data-clipboard-target="#kouling">
									点击复制</button></p>
								
								</div>


							<div class="social-or-login center">
								<span>点击按钮或长按全选复制上方淘口令<br/>打开「手机淘宝」即可「领取优惠券」并购买</span>
							</div><!-- /widget-main -->



									
								</div><!-- /widget-main -->
								
							</div><!-- /widget-body -->
						</div><!-- /login-box -->

					</div><!-- /position-relative -->
				</div>
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div>
</div>


</body>

    <!-- 1. Define some markup -->
	<!--div id="logo1"><img src = 'http://f.51240.com/img/logo.gif?v=16091404' /></div>
    

    <!-- 2. Include library -->
    <script src="__PUBLIC__/js/Clipboard/clipboard.min.js"></script>

    <!-- 3. Instantiate clipboard -->
    <script>
	$(document).ready(function(){
		var qunid = <{$Think.get.qunid}>;
		var goodsid = <{$Think.get.goodsid}>;
		get_kl(qunid,goodsid);
		
		
	});





	function get_kl(qunid,goodsid)
	{
		 var timestamp =Date.parse(new Date());	
	 $.ajax(
		{
			type: 'post',
			url: '/index.php/Home/Ajax/getKouling',
			cache:false,
			dataType: 'json',
			data: {'qunid':qunid,"goodsid": goodsid,"clicktime":timestamp},
			async: false,
			beforeSend:function()
			{//触发ajax请求开始时执行
				//$("p").append("--马上提交--");
			},                
			success: function (msg, textStatus) 
			{//有数据返回时
				//alert(msg.result);
				if(msg.result==1)
				{
					$("#kouling"+msg.info).html(msg.msgs);
				}
				else
				{
				   $("#kouling"+msg.info).html("获取失败");              
				}
			},
			error:function (textStatus) 
			{//网络繁忙 错误
			   //$("p").append("--网络繁忙--错");                  
			},
			complete: function(msg, textStatus)
			{ //ajax请求完成时执行                 
				if(msg.result==1)
				{
				  // $("p").append("--请求完成时执行--");   
				}
			}                
		});  
	}	
	
	
	
	
	
    var clipboard = new Clipboard('.btn');

    clipboard.on('success', function(e) {
        console.log(e);
    });

    clipboard.on('error', function(e) {
        console.log(e);
    });
    </script>


</html>